package com.jk.miaodiyun.httpApiDemo;

import com.jk.miaodiyun.httpApiDemo.common.Config;
import com.jk.miaodiyun.httpApiDemo.common.Config;
import com.jk.miaodiyun.httpApiDemo.common.HttpUtil;

/**
 * 验证码通知短信接口
 * 
 * @ClassName: IndustrySMS
 * @Description: 验证码通知短信接口
 *
 */
public class IndustrySMS
{
	private static String operation = "/industrySMS/sendSMS";

	private static String accountSid = Config.ACCOUNT_SID;
	private static String to = "";
	private static String smsContent = "【金隅时代】欢迎来到金隅时代，打造属于自己的平台。验证码为{1}";

	/**
	 * 验证码通知短信
	 */
	public static void execute()
	{
		String url = Config.BASE_URL + operation;
		String body = "accountSid=" + accountSid + "&to=" + to + "&smsContent=" + smsContent
				+ HttpUtil.createCommonParam();

		// 提交请求
		String result = HttpUtil.post(url, body);
		System.out.println("result:" + System.lineSeparator() + result);
	}

	/**
	 * 验证码通知短信
	 */
	public static void execute(String phoneNumber, int msg)
	{
		String url = Config.BASE_URL + operation;
		String body = "accountSid=" + accountSid + "&to=" + phoneNumber + "&smsContent=" + smsContent
				+msg+ HttpUtil.createCommonParam();

		// 提交请求
		String result = HttpUtil.post(url, body);
		System.out.println("result:" + System.lineSeparator() + result);
	}
}
